<html>
    <head>
        <title> fibonacci</title>
    </head>
    
    <body>
        <div>
            <form method="post" action="fibonaci.php">
                <p> Input Jumlah Hitungan :
                <input type="text" name="bilangan"/></p>
                <input type="submit" name="submit" value="hitung"/>
                </form>
                
            </div>
        
<?php
if (!empty ($_POST['bilangan']))
{
$n=$_POST['bilangan'];

$a=0;
$b=1;
//echo "$a $b";
for ($i=0;$i<=$n;$i++)
{
    $sbaru = $a + $b;
    echo "$sbaru" ;
    $a=$b;
    $b=$sbaru;
}

}
